package io.yizoo.core.flow;

import com.fasterxml.jackson.databind.JsonNode;

public class FlowType {
    public final static String flow_status_initialized= "initialized";
    public final static String flow_status_running= "running";
    public final static String flow_status_completed= "completed";

    public final static String node_type_start= "start";
    public final static String node_type_end= "end";
    public final static String node_type_normal= "normal";

    public final static String node_user_type_user= "user";
    public final static String node_user_type_org= "org";
    public final static String node_user_type_role= "role";
    public final static String node_user_type_zjsj= "zjsj";

    public final static String node_status_running= "running";
    public final static String node_status_completed= "completed";
    public final static String node_status_waiting= "waiting";

    public final static String node_user_status_running= "running";
    public final static String node_user_status_completed= "completed";
    public final static String node_user_status_waiting= "waiting";

    public final static String node_policy_need_one_user= "抢签";
    public final static String node_policy_need_every_user= "会签";

    public final static String node_user_policy_all= "全部参与者";
    public final static String node_user_policy_select= "手选参与者";

    public final static String node_pb_policy_toFirst_eNext= "退首顺回";
    public final static String node_pb_policy_toFirst_eJump= "退首跳回";
    public final static String node_pb_policy_toSelected_eNext= "手选顺回";
    public final static String node_pb_policy_toSelected_eJump= "手选跳回";
    public final static String node_pb_policy_toLast_eNext= "顺退顺回";
    public final static String node_pb_policy_toLast_eJump= "顺退跳回";
    public final static String node_pb_policy_No= "不可退回";

    public final static String node_push_back_status_running= "running";
    public final static String node_push_back_status_completed= "completed";

    public static boolean isJsonNodeItemNull(JsonNode nn, String index){
        if(nn==null || nn.get(index)==null || nn.get(index).isNull()){return true;}
        return false;
    }
    public static String getJsonNodeItemTextNull(JsonNode nn, String index){
        if(nn==null || nn.get(index)==null || nn.get(index).isNull()){return null;}
        return nn.get(index).asText();
    }
}
